Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Delta] When checks schema for writing, Delta enforces not null on a Nested Field only when its parent is not null #4121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harperjiang
Copy link
Contributor

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

This PR corrects Delta's handling of nullable checks for nested fields when writing data.

For example, consider the schema:

STRUCT<foo: STRUCT<bar: INT NOT NULL, bar2: INT>>

Previously, Delta rejected NULL values for foo, even when it was marked as nullable. This was because a NULL foo would also make foo.bar NULL.

With this change, Delta now enforces foo.bar as non-null only when foo itself is non-null. As a result:

  • foo = NULL is now accepted.
  • foo = { bar = NULL, bar2 = 1 } remains rejected.

How was this patch tested?

UT

Does this PR introduce any user-facing changes?

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant